Skip to content

Harden menubar: refresh loop, concurrency, data sync, edge cases#188

Merged
iamtoruk merged 1 commit intomainfrom
feat/menubar-hardening
May 1, 2026
Merged

Harden menubar: refresh loop, concurrency, data sync, edge cases#188
iamtoruk merged 1 commit intomainfrom
feat/menubar-hardening

Conversation

@iamtoruk
Copy link
Copy Markdown
Member

@iamtoruk iamtoruk commented May 1, 2026

Summary

  • Fix refresh loop that never repeated (single-fire Task → proper while loop with 30s interval)
  • Fix loading overlay flicker with counter-based isLoading for concurrent fetches
  • Fix rapid tab switching race with switchTask cancellation + Task.isCancelled guard
  • Fix tab strip vs hero cost desync by fetching provider + all-provider data in parallel
  • Fix stale menubar icon after wake by refreshing today/all in forceRefresh
  • Fix accent color propagation: ThemeState → @observable, removes .id() teardown hack
  • Fix currency flash: defer symbol+rate update until rate is available (atomic apply)
  • Fix export UI freeze: terminationHandler instead of waitUntilExit, HHmmss filename uniquifier
  • Fix CurrencyState: proper @mainactor + Sendable, nonisolated on pure functions
  • Fix streak count: calendar-day iteration instead of sparse history entries
  • Fix TrendBar identity: stable date-based id instead of UUID
  • Add GPT-5.3 and DeepSeek model display names

Test plan

  • Open menubar, verify data loads and refreshes every 30s
  • Rapidly click provider tabs — only final tab's data should load
  • Switch accent colors — instant, no state loss
  • Switch to uncached currency — no flash of wrong values
  • Export twice quickly — unique filenames in Downloads
  • Sleep/wake Mac — menubar icon updates immediately

- Fix refresh loop: proper while loop with 30s sleep and force:true
  instead of single-fire Task that never repeated
- Fix loading overlay: counter-based isLoading so concurrent fetches
  don't flicker the overlay on/off
- Fix rapid tab switching: cancel previous switchTask, check
  Task.isCancelled after CLI returns to discard stale results
- Fix tab strip vs hero desync: fetch provider-specific and all-provider
  data in parallel so costs arrive from same data snapshot
- Fix stale menubar icon after wake: forceRefresh now fetches today/all
  in parallel alongside the current selection
- Fix accent color: ThemeState is now @observable so color changes
  propagate via observation, removing .id() view hierarchy teardown
- Fix currency flash: defer store.currency and symbol update until a
  rate is available so symbol and rate apply atomically
- Fix export: terminationHandler instead of waitUntilExit (no UI freeze),
  HHmmss in filename to prevent overwrite on double-export
- Fix CurrencyState: @mainactor isolation with proper Sendable
  conformance, nonisolated on pure static functions
- Fix streak count: iterate calendar days instead of sparse history
  entries so gaps are counted as streak-breakers
- Fix TrendBar identity: stable date-based id instead of UUID
- Add GPT-5.3 and DeepSeek model display names
@iamtoruk iamtoruk merged commit ffc0e48 into main May 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant